package com.coder.bike.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * <p>
 * 共享单车违规记录
 * </p>
 *
 * @author 沈诩宸
 * @since 2025-04-22
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("busi_violation")
@ApiModel(value = "Violation对象", description = "共享单车违规记录")
public class Violation implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("违规ID")
    @TableId(value = "violation_id", type = IdType.AUTO)
    private Long violationId;

    @ApiModelProperty("单车编号")
    private String bikeNum;

    @ApiModelProperty("违规用户ID")
    private Long userId;

    @ApiModelProperty("违规时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime violationTime;

    @ApiModelProperty("违规类型：1-乱停乱放 2-破坏车辆 3-未关锁 4-超区骑行 5-其他")
    private Byte type;

    @ApiModelProperty("违规详细备注")
    private String reason;

    @ApiModelProperty("详细地址")
    private String address;

    @ApiModelProperty("证据（照片/视频）")
    private String evidence;

    @ApiModelProperty("信用分扣除")
    private Integer creditDeduction;

    @ApiModelProperty("罚款金额")
    private BigDecimal fine;

    @ApiModelProperty("状态：0-待处理 1-已处理 2-申诉中")
    private Byte status;

    @ApiModelProperty("处理人员")
    private String handler;

    @ApiModelProperty("更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @ApiModelProperty("逻辑删除")
    private Boolean deleted;

    @TableField(exist = false)
    private Integer lowFine;
    @TableField(exist = false)
    private Integer highFine;
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lowViolationTime;
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime highViolationTime;
}
